<input type="hidden" value="{$data.id}" id="id"/>
<div class="box box-warning">
    <div class="box-header with-border">
        <h3 class="box-title">
            <empty name="data.id">添加公告<else />修改公告信息</empty>
        </h3>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <form role="form">
            <!-- text input -->
            <div class="form-group">
                <label>公告标题</label>
                <input id="title" type="text" value="{$data.title}" class="form-control" placeholder="公告标题">
            </div>
            <div class="form-group">
                <label>内容</label>
                <textarea class="form-control" id="content_txt" rows="5" placeholder="内容">{$data.content}</textarea>
            </div>
        </form>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <button id="save" type="button" class="btn btn-info" style="width:120px;">保存</button>
        <button id="cancel" type="button" class="btn btn-default pull-right" style="width:90px;">取消</button>
    </div>
    <div class="overlay hidden">
        <i class="fa fa-refresh fa-spin"></i>
    </div>
</div>
<script type="text/javascript">
//模块名称定义
var moduleName = 'sys';

$(".select2").select2({
    minimumResultsForSearch: Infinity,
    language: "zh-CN"
});

//取消
$('#cancel').on('click', function() {
    window.location.href = '__ADMIN__#' + moduleName + '/notice';
});

$('#save').on('click', function() {
    showLoad();
    $.ajax({
        type : "post",
        url : '__ADMIN__/' + moduleName + '/addoreditnoticedata',
        dataType:"json",
        data: {
            id : $('#id').val()
            ,title : $('#title').val()
            ,content : $('#content_txt').val()
            //多条件查询在此添加提交数据
        },
        success : function(msg) {
            //layer.msg(msg.msg);
            if (msg.code == 0)
                $.scojs_message(msg.msg, $.scojs_message.TYPE_OK);
            else
                $.scojs_message(msg.msg, $.scojs_message.TYPE_ERROR);
            hideLoad();
        }
    });
});
</script>